﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SelfAddWorkHeader.ascx.vb"
    Inherits="WebForm_SelfManageWorkHeader_SelfAddWorkHeader" %>
<%@ Register Namespace="My" TagPrefix="cc2" %>
<%@ Register Assembly="CheckBoxRequireControl" Namespace="CheckBoxRequireControl"
    TagPrefix="cc1" %>
<%@ Register Src="~/WebForm/CommonControl/UploadPicControl.ascx" TagName="UploadPicControl"
    TagPrefix="uc1" %>
<%@ Register Src="~/WebForm/CommonControl/CalendarTextBox.ascx" TagName="CalendarTextBox"
    TagPrefix="My" %>
<%@ Register Src="~/WebForm/ManageWorkContent/SelfRegionType.ascx" TagName="SelfRegionType"
    TagPrefix="My" %>
<%@ Reference Control="~/WebForm/CommonControl/CalendarTextBox.ascx" %>
<%@ Reference Control="~/WebForm/ManageWorkContent/SelfRegionType.ascx" %>
<asp:FormView ID="fv" runat="server" DefaultMode="ReadOnly">
    <ItemTemplate>
        <table width="100%" align="center">
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="lblReportDate" runat="server" meta:resourcekey="lblReportDate"></asp:Label></td>
                <td>
                    <My:CalendarTextBox ID="txtReportDate" runat="server" />
                    <%--                    <asp:TextBox ID="txtReportDate" runat="server" Text='<%#Bind("ReportDate","{0:yyyy/MM/dd}") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" meta:resourcekey="rfvReportDate" runat="server" ControlToValidate="txtReportDate"
                    Display="None" SetFocusOnError="True" ValidationGroup="vInsert"></asp:RequiredFieldValidator>
                    <ajaxToolkit:CalendarExtender ID="ceReportDate" runat="server" Format="yyyy/MM/dd" TargetControlID="txtReportDate">
                    </ajaxToolkit:CalendarExtender>
                    <asp:CompareValidator meta:resourcekey="cvReportDate" ID="cvReportDate" runat="server" ControlToValidate="txtReportDate" Display="None"
                        Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="vInsert"></asp:CompareValidator>
--%>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblLocation" runat="server" meta:resourcekey="lblLocation"></asp:Label>
                </td>
                <td>
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <asp:UpdatePanel ID="upTownID" runat="server" UpdateMode="conditional">
                                    <ContentTemplate>
                                        <asp:DropDownList ID="ddlTownID" runat="server" OnSelectedIndexChanged="ddlTownID_SelectedIndexChanged"
                                            AutoPostBack="true">
                                        </asp:DropDownList>
                                        <asp:DropDownList ID="ddlVillageID" runat="server">
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" meta:resourcekey="rfvTownID"
                                            runat="server" ControlToValidate="ddlTownID" Display="None" SetFocusOnError="True"
                                            ValidationGroup="vInsert"></asp:RequiredFieldValidator>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td>
                                <asp:TextBox ID="txtLocation" runat="server" Text='<%# Eval("Location") %>'></asp:TextBox>
                                <asp:Label ID="lblLocationDescription" runat="server" SkinID="tip" meta:resourcekey="lblLocationDescription"></asp:Label>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" meta:resourcekey="rfvLocation"
                                    runat="server" ControlToValidate="txtLocation" Display="None" SetFocusOnError="True"
                                    ValidationGroup="vInsert"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="lblDescription" runat="server" meta:resourcekey="lblDescription"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtDescription" Columns="50" MaxLength="50" runat="server" Text='<%# Eval("Description") %>'></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="lblRegionType" runat="server" meta:resourcekey="lblRegionType"></asp:Label></td>
                <td>
                    <My:SelfRegionType ID="SelfRegionType1" runat="server" />
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="lblDirtyItem" runat="server" meta:resourcekey="lblDirtyItem"></asp:Label></td>
                <td>
                    <My:MyGridView ID="gvDirtyItem" SkinID="pager" runat="server" AllowHoverSelect="False" AllowPaging="false"
                        AllowHoverEffect="False" ShowHeader="False" MySortDirection="Ascending" TotalRowCount="0"
                        OnDataBound="gvDirtyItem_DataBound" Width="100%" BackColor="White" BorderColor="#3366CC"
                        BorderWidth="1px" CellPadding="4">
                        <Columns>
                            <asp:TemplateField>
                                <itemtemplate>
<asp:Label id="lblDirtyItemName" runat="server" Text='<%# Eval("Text") %>' __designer:wfdid="w83"></asp:Label> 
</itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <itemtemplate>
<asp:CheckBoxList id="cbList" runat="server" __designer:wfdid="w84" Visible="false"></asp:CheckBoxList> 
<asp:Label id="lblSubValue" runat="server" Text='<%# Eval("SubValue") %>' __designer:wfdid="w85" Visible="False"></asp:Label>
<asp:Label id="lblSubText" runat="server" Text='<%# Eval("SubText") %>' __designer:wfdid="w87" Visible="true"></asp:Label> 
</itemtemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <itemtemplate>
共計<asp:TextBox id="txtNum" runat="server" Width="35%" __designer:wfdid="w81"></asp:TextBox>處/個數 <asp:Label id="lblValue" runat="server" Text='<%# Eval("Value") %>' __designer:wfdid="w82" Visible="False"></asp:Label>
</itemtemplate>
                                <itemstyle width="35%" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <itemtemplate>
<asp:DropDownList id="ddlDirtyLevel" runat="server" __designer:wfdid="w47"></asp:DropDownList> 
</itemtemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                        <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                        <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                        <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                        <RowStyle BackColor="White" ForeColor="#003399" />
                    </My:MyGridView>
                    <br />
                    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
                        <ItemTemplate>
                            <table>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblDirtyLevel" runat="server" Text='<%# Eval("DirtyLevel") %>'></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblDirtyLevelDiscription" runat="server" Text='<%# Eval("DirtyLevelDiscription") %>'></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:Repeater>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
                        SelectCommand="select b.Text + ':' as DirtyLevel,a.Text as DirtyLevelDiscription from codemapping a inner join codemapping b on a.Value = b.Value where a.tablename = 'FindDirtyItem' and a.columnName = 'DirtyLevelText' and b.tablename = 'FindDirtyItem' and b.columnName = 'DirtyLevel' ">
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblPhotoPathID" runat="server" meta:resourcekey="lblPhotoPathID"></asp:Label>
                </td>
                <td>
                    <uc1:UploadPicControl ID="UploadPicControl1" runat="server" strClass="FindDirtyHeaderPhoto"
                        strGUID='<%# Eval("PhotoPathID") %>' FileSizeLimit="30000" />
                </td>
            </tr>
            <tr>
                <td align="right">
                </td>
                <td>
                    <asp:Button ID="btnSave" runat="server" CommandName="btnSave" meta:resourcekey="btnSave"
                        OnClientClick="" ValidationGroup="vInsert" />
                    <ajaxToolkit:ConfirmButtonExtender ID="cbSave" runat="server" meta:resourcekey="cbSave"
                        TargetControlID="btnSave">
                    </ajaxToolkit:ConfirmButtonExtender>
                </td>
            </tr>
        </table>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" ValidationGroup="vInsert" />
    </ItemTemplate>
</asp:FormView>
